function findEmployeeDetail(id) {
	window.location.href = "employee_info?id=" + id;
}

function search() {
	window.location.href = "employee?employeePosition="
			+ $("#employeePosition").val() + "&type=" + $("#type").val()
			+ "&employeeName=" + $("#employeeName").val();
}

function getQueryString(name) {
	var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
	var r = window.location.search.substr(1).match(reg);
	if (r != null) {
		return decodeURI(r[2]);
	} else {
		return null;
	}
}

$(function() {
	if (getQueryString("employeePosition") != null
			&& getQueryString("type") != null) {
		$("#employeePosition").val(getQueryString("employeePosition"));
		$("#type").val(getQueryString("type"));
		$("#employeeName").val(getQueryString("employeeName"));
	}
})
